layui.use(['carousel', 'form','element'], function() {
    var carousel = layui.carousel
        , form = layui.form,
        element=layui.element;
    var $=layui.$;
    //常规轮播
    carousel.render({
        elem: '#test1',
        interval: 3000,
        anim:'fade',//动画类型：左右切换
        width:800,
        height:450
    });
    $(function () {
        $.ajax({
            type:'post',
            url:'/Ticket/ticketLogInfo/progress',
            dataType:'json',
            success:function (res) {
                if(res.code==0)
                {
                    var pay=res.data[0].pay+'%';
                    var pay0=(100-res.data[0].pay)+'%';
                    element.progress('demoUp', pay);
                    $("#demoUp").attr("lay-percent",pay);
                    element.progress('demoDown', pay0);
                    $("#demoDown").attr("lay-percent",pay0);
                    element.init();
                }
                else layer.msg(res.msg);
            }
        })
    });
});